<?php

namespace App\Models\Relations;

use App\Models\ImUserNoticeStatus;

trait ImUserHasNotice
{
    public static function bootImUserHasNotice()
    {
        // 用户创建后事件
        static::created(function ($user) {
            $info = ImUserNoticeStatus::firstOrCreate(
                ['user_id' => $user->id]
            );

            if ($info === false) {
                return false;
            }
        });
    }
}
